package com.example.demo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.config.annotation.EnableWebSocket;

@Slf4j
@SpringBootApplication
//@MapperScan("com.example.demo.mapper")
@RestController
@EnableWebSocket
@EnableAsync
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    //    @GetMapping("/queryBelong")
//    public Object queryBelong(String phoneNumber) {
//        Map data = new HashMap();
//        List list = new ArrayList();
//        List<String> strings = Arrays.asList(phoneNumber.replaceAll(" ",",").split(","));
//        for (String s : strings) {
//            Map params = new HashMap();
//            params.put("state", "A3540588%2Fl6x9");
//            params.put("phone", s);
//            HttpResponse response = HttpRequest.post("http://weixin.170cz.cn/weixin/qm/numbercheck")
//                    .form(params).execute();
//            HttpResponse balance = HttpRequest.post("http://weixin.170cz.cn/weixin/query/balance")
//                    .form(params).execute();
//            Map map = JSONUtil.readValue(response.body(), Map.class);
//            Map ye = JSONUtil.readValue(balance.body(), Map.class);
//            map.put("phoneNumber", s);
//            if (ye.get("return").equals("success")){
//                map.put("balance", ye.get("balance"));
//                map.put("name", ye.get("name"));
//            }
//        }
//        data.put("data", list);
//        data.put("code", HttpStatus.HTTP_OK);
//        return data;
//    }

}
